﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TY_Hoist.WinApp.Code
{
    /// <summary>
    /// 8路继电器通讯命令
    /// </summary>
    public class RelayCmd
    {
        /// <summary>
        /// 吸合所有命令
        /// </summary>
        public static readonly byte[] RELAY_ALL_ON = { 0x01, 0x0F, 0x00, 0x00, 0x00, 0x08, 0x02, 0xFF, 0xFF, 0xE5, 0x30 };
        /// <summary>
        /// 断开所有命令
        /// </summary>
        public static readonly byte[] RELAY_ALL_OFF = { 0x01, 0x0F, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0xE4, 0x80 };
        /// <summary>
        /// 吸合第一路命令
        /// </summary>
        public static readonly byte[] RELAY_1_ON = { 0x01, 0x05, 0x00, 0x00, 0xFF, 0x00, 0x8C, 0x3A };
        /// <summary>
        /// 断开第一路命令
        /// </summary>
        public static readonly byte[] RELAY_1_OFF = { 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0xCD, 0xCA };
        /// <summary>
        /// 吸合第二路命令
        /// </summary>
        public static readonly byte[] RELAY_2_ON = { 0x01, 0x05, 0x00, 0x01, 0xFF, 0x00, 0xDD, 0xFA };
        /// <summary>
        /// 断开第二路命令
        /// </summary>
        public static readonly byte[] RELAY_2_OFF = { 0x01, 0x05, 0x00, 0x01, 0x00, 0x00, 0x9C, 0x0A };
        /// <summary>
        /// 吸合第三路命令
        /// </summary>
        public static readonly byte[] RELAY_3_ON = { 0x01, 0x05, 0x00, 0x02, 0xFF, 0x00, 0x2D, 0xFA };
        /// <summary>
        /// 断开第三路命令
        /// </summary>
        public static readonly byte[] RELAY_3_OFF = { 0x01, 0x05, 0x00, 0x02, 0x00, 0x00, 0x6C, 0x0A };
        /// <summary>
        /// 吸合第四路命令
        /// </summary>
        public static readonly byte[] RELAY_4_ON = { 0x01, 0x05, 0x00, 0x03, 0xFF, 0x00, 0x7C, 0x3A };
        /// <summary>
        /// 断开第四路命令
        /// </summary>
        public static readonly byte[] RELAY_4_OFF = { 0x01, 0x05, 0x00, 0x03, 0x00, 0x00, 0x3D, 0xCA };
        /// <summary>
        /// 吸合第五路命令
        /// </summary>
        public static readonly byte[] RELAY_5_ON = { 0x01, 0x05, 0x00, 0x04, 0xFF, 0x00, 0xCD, 0xFB };
        /// <summary>
        /// 断开第五路命令
        /// </summary>
        public static readonly byte[] RELAY_5_OFF = { 0x01, 0x05, 0x00, 0x04, 0x00, 0x00, 0x8C, 0x0B };
        /// <summary>
        /// 吸合第六路命令
        /// </summary>
        public static readonly byte[] RELAY_6_ON = { 0x01, 0x05, 0x00, 0x05, 0xFF, 0x00, 0x9C, 0x3B };
        /// <summary>
        /// 断开第六路命令
        /// </summary>
        public static readonly byte[] RELAY_6_OFF = { 0x01, 0x05, 0x00, 0x05, 0x00, 0x00, 0xDD, 0xCB };
        /// <summary>
        /// 吸合第七路命令
        /// </summary>
        public static readonly byte[] RELAY_7_ON = { 0x01, 0x05, 0x00, 0x06, 0xFF, 0x00, 0x6C, 0x3B };
        /// <summary>
        /// 断开第七路命令
        /// </summary>
        public static readonly byte[] RELAY_7_OFF = { 0x01, 0x05, 0x00, 0x06, 0x00, 0x00, 0x2D, 0xCB };
        /// <summary>
        /// 吸合第八路命令
        /// </summary>
        public static readonly byte[] RELAY_8_ON = { 0x01, 0x05, 0x00, 0x07, 0xFF, 0x00, 0x3D, 0xFB };
        /// <summary>
        /// 断开第八路命令
        /// </summary>
        public static readonly byte[] RELAY_8_OFF = { 0x01, 0x05, 0x00, 0x07, 0x00, 0x00, 0x7C, 0x0B };

        /// <summary>
        /// 查询命令
        /// </summary>
        public static readonly byte[] RELAY_SEARCH = { 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x79, 0xCC };
    }
}
